package edu.gduf.dto;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class PageType<T> implements Serializable {
	private final int DEFAULT_PAGE_SIZE = 10;
	private final int DEFAULT_PAGE_NUM = 1;
	private int page = DEFAULT_PAGE_NUM;
	private int rows = DEFAULT_PAGE_SIZE;
	private long total;
	private T entity;

	private Map<String, Object> data = new HashMap<String, Object>();

	private int start;

	public T getEntity() {
		return entity;
	}

	public void setEntity(T entity) {
		this.entity = entity;
	}

	public Map<String, Object> getData() {
		return data;
	}

	public void setData(Map<String, Object> data) {
		this.data = data;
	}

	public int getStart() {
		return (page - 1) * rows;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

}
